<?php

namespace app\model;

use support\Db;
use support\Model;

class WaRules
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'wa_rules';

    /**
     * The primary key associated with the table.
     *
     * @var string
     */
    protected $primaryKey = 'id';

    /**
     * Indicates if the model should be timestamped.
     *
     * @var bool
     */
    public $timestamps = false;

    /**
     * 菜单列表
     * @return false|string
     */
    public static function all()
    {
        $pageNum = 10;
        $list = Db::table('wa_rules')
            ->select('*')
            ->paginate($pageNum);

        return json_encode($list);
    }
}